#ifndef SKILL_H
#define SKILL_H


#include "dtwenty_global.h"
#include "dtwentyitem.h"
#include "dtwentyitemcontainer.h"


class DTWENTYSHARED_EXPORT Skill : public DTwentyItem
{
    Q_OBJECT

    class Data : public QSharedData
    {
    public:
        Data()
        {
            attribute = "not set";
        }
        Data(const Data& other) : QSharedData(other)
        {
            attribute = other.attribute;
        }

        QString attribute;
    };

    Q_PROPERTY(QString attribute READ attribute WRITE setAttribute)


public:

    Q_INVOKABLE Skill(DTwentyItem *parent = 0);
    Skill(const Skill& other);

    virtual int type() const;

    QString attribute() const;
    void setAttribute(const QString& attribute);


private:

    QExplicitlySharedDataPointer<Data> d;


};

Q_DECLARE_METATYPE(Skill)


class DTWENTYSHARED_EXPORT Skills : public DTwentyItemContainer
{
    Q_OBJECT

    Q_PROPERTY(QString attributeTitle READ attributeTitle)


public:

    Q_INVOKABLE Skills(QObject* parent = 0) :
        DTwentyItemContainer(parent)
    {
        registerChildType<Skill>();
        setChildrenOrdered(true);
    }

    Skills(const Skills& other) :
        DTwentyItemContainer(other)
    {
    }

    virtual int type() const
    {
        return qMetaTypeId<Skills*>();
    }

    QString attributeTitle() const
    {
        return tr("Attribute");
    }

};
Q_DECLARE_METATYPE(Skills)


#endif // SKILL_H

